package l1j.server.server.model.damage.hit;



import l1j.server.server.model.L1Character;
import l1j.server.server.model.Instance.L1NpcInstance;
import l1j.server.server.model.Instance.L1PcInstance;

public abstract class L1Hit {
	
	
	public static L1Hit get(L1Character attacker, L1Character target) {
		if (attacker instanceof L1PcInstance) {
			if (target instanceof L1PcInstance) {
				return new L1Hit_Pc_Pc((L1PcInstance) attacker,
						(L1PcInstance) target);
			}
			return new L1Hit_Pc_Npc((L1PcInstance) attacker,
					(L1NpcInstance) target);
		} else {
			if (target instanceof L1PcInstance) {
				return new L1Hit_Npc_Pc((L1NpcInstance) attacker,
						(L1PcInstance) target);
			}
			return new L1Hit_Npc_Npc((L1NpcInstance) attacker,
					(L1NpcInstance) target);
		}
	}


	protected boolean _isHit = false;

	public boolean isHit(){
		return _isHit;
	}
	
	protected int _hitRate = 0;
	
	public abstract boolean calcHit();




}
